3.427 \(\int \cos (c+d x) (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=28 \[ \frac {(a-b) \sin (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

b*arctanh(sin(d*x+c))/d+(a-b)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3676, 388, 206} \[ \frac {(a-b) \sin (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Tan[c + d*x]^2),x]

[Out]

(b*ArcTanh[Sin[c + d*x]])/d + ((a - b)*Sin[c + d*x])/d

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {a-(a-b) x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {(a-b) \sin (c+d x)}{d}+\frac {b \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {(a-b) \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 47, normalized size = 1.68 \[ \frac {a \sin (c) \cos (d x)}{d}+\frac {a \cos (c) \sin (d x)}{d}-\frac {b \sin (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Tan[c + d*x]^2),x]

[Out]

(b*ArcTanh[Sin[c + d*x]])/d + (a*Cos[d*x]*Sin[c])/d + (a*Cos[c]*Sin[d*x])/d - (b*Sin[c + d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.56, size = 44, normalized size = 1.57 \[ \frac {b \log \left (\sin \left (d x + c\right ) + 1\right ) - b \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (a - b\right )} \sin \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(b*log(sin(d*x + c) + 1) - b*log(-sin(d*x + c) + 1) + 2*(a - b)*sin(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 1.49, size = 48, normalized size = 1.71 \[ \frac {b {\left (\log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - 2 \, \sin \left (d x + c\right )\right )} + 2 \, a \sin \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(b*(log(abs(sin(d*x + c) + 1)) - log(abs(sin(d*x + c) - 1)) - 2*sin(d*x + c)) + 2*a*sin(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 0.37, size = 44, normalized size = 1.57 \[ \frac {a \sin \left (d x +c \right )}{d}-\frac {b \sin \left (d x +c \right )}{d}+\frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*tan(d*x+c)^2),x)

[Out]

a*sin(d*x+c)/d-b*sin(d*x+c)/d+1/d*b*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 46, normalized size = 1.64 \[ \frac {b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 2 \, a \sin \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*(b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)) + 2*a*sin(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 11.87, size = 32, normalized size = 1.14 \[ \frac {\sin \left (c+d\,x\right )\,\left (a-b\right )}{d}+\frac {2\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a + b*tan(c + d*x)^2),x)

[Out]

(sin(c + d*x)*(a - b))/d + (2*b*atanh(tan(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*cos(c + d*x), x)

________________________________________________________________________________________